package com.sutuijingling.bean;

import com.google.gson.f;
import com.google.gson.j;
import com.google.gson.m;
import com.google.gson.o;
import com.sutuijingling.utils.e;
import java.io.File;
import java.io.IOException;
import org.apache.commons.io.b;
import org.apache.http.HttpStatus;

public class TopBean {
    AccountBean acc;
    int code = HttpStatus.SC_OK;
    f netflow;
    SearchBean searchBean;
    long taskId;
    String type = null;

    public static void main(String[] strArr) {
        try {
            parseFromJson(b.b(new File("D:\\d.txt")), "123456");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static h mockOne() {
        AccountBean accountBean = new AccountBean(true, "要你泥要吐土", "qt3633qt", e.a);
        h hVar = new h();
        hVar.a(accountBean);
        i iVar = new i();
        iVar.a("杭州市");
        iVar.c("电信");
        iVar.b("183.156.55.233");
        hVar.a(iVar);
        return hVar;
    }

    public static TopBean parseFromJson(m mVar, String str) {
        if (!mVar.a("ok") || mVar.b("ok").f()) {
            f fVar = new f();
            TopBean topBean = new TopBean();
            j b = mVar.b("taskId");
            if (!(b == null || b.j())) {
                topBean.taskId = b.d();
            }
            b = mVar.b("code");
            if (!(b == null || b.j())) {
                topBean.code = b.e();
            }
            b = mVar.b("netflow");
            if (!(b == null || b.j())) {
                topBean.netflow = (f) fVar.a(b, f.class);
            }
            b = mVar.b("taskParam");
            if (!(b == null || b.j())) {
                m k = b.k();
                if (!k.a("city")) {
                    k.a("city", e.a);
                }
                if (!k.a("province")) {
                    k.a("province", e.a);
                }
                topBean.searchBean = (SearchBean) fVar.a(b, SearchBean.class);
            }
            b = mVar.b("type");
            if (!(b == null || b.j())) {
                topBean.type = b.b();
            }
            return topBean;
        }
        com.sutuijingling.utils.b.b(" not ok...return null", new Object[0]);
        return null;
    }

    public static TopBean parseFromJson(String str, String str2) {
        com.sutuijingling.utils.b.b(" prase from top ::" + str, new Object[0]);
        j a = new o().a(str);
        return (a == null || a.j()) ? null : parseFromJson(a.k(), str2);
    }

    public AccountBean getAcc() {
        return this.acc;
    }

    public int getCode() {
        return this.code;
    }

    public f getNetflow() {
        return this.netflow;
    }

    public SearchBean getSearchBean() {
        return this.searchBean;
    }

    public long getTaskId() {
        return this.taskId;
    }

    public String getType() {
        return this.type;
    }

    public void setAcc(AccountBean accountBean) {
        this.acc = accountBean;
    }

    public void setCode(int i) {
        this.code = i;
    }

    public void setNetflow(f fVar) {
        this.netflow = fVar;
    }

    public void setSearchBean(SearchBean searchBean) {
        this.searchBean = searchBean;
    }

    public void setTaskId(long j) {
        this.taskId = j;
    }

    public void setType(String str) {
        this.type = str;
    }

    public String toString() {
        return "TopBean [netflow=" + this.netflow + ", acc=" + this.acc + ", searchBean=" + this.searchBean + ", taskId=" + this.taskId + ", type=" + this.type + ", code=" + this.code + "]";
    }
}
